home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 11 - 1995 / 11.02 Feb 95 / Yenta / C Libraries / ConvertTools.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-04  |  1.2 KB  |  33 lines  |  [TEXT/KAHL]

  1. #pragma once
  2.  
  3. /*=======================================================================*/
  4. /*= This file contains a set of utilities for converting text & strings =*/
  5. /*=======================================================================*/
  6.  
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10.  
  11.     Ptr    Data2Ptr (void *InData, short DataLen);
  12.     /* return a new pointer containing DataLen bytes of InData */
  13.     
  14.     StringPtr Data2PString (void *InData, short DataLen);
  15.     /* return a new pointer containing a pstring constructed from InData */
  16.  
  17.     StringPtr Text2PString (Handle TheString);
  18.     /* given a handle to a raw text string, return a pointer to a Pascal style string */
  19.  
  20.     Handle    PString2Text (StringPtr TheString);
  21.     /* given a Pascal string, return a handle to the raw text it contained */
  22.  
  23.     void    CToPString (char *CStr, Str255 *PStr, short maxLen);
  24.     /* convert maxLen characters of the the c string passed in CStr into a */
  25.     /* pascal-syle string.  PStr must already by allocated */
  26.     
  27.     void    PToCString (StringPtr PString, char *CStr, short maxLen);
  28.     /* convert maxLen characters of the the pascal string passed in PStr into a */
  29.     /* c-syle string.  CStr must already by allocated */
  30.  
  31. #ifdef __cplusplus
  32. }
  33. #endif